import 'package:flutter2/generated/json/base/json_convert_content.dart';
import 'package:flutter2/model/pay_channel_entity.dart';

PayChannelEntity $PayChannelEntityFromJson(Map<String, dynamic> json) {
  final PayChannelEntity payChannelEntity = PayChannelEntity();
  final String? name = jsonConvert.convert<String>(json['razorabsorb']);
  if (name != null) {
    payChannelEntity.name = name;
  }
  final String? channel = jsonConvert.convert<String>(json['whenclever']);
  if (channel != null) {
    payChannelEntity.channel = channel;
  }
  return payChannelEntity;
}

Map<String, dynamic> $PayChannelEntityToJson(PayChannelEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['razorabsorb'] = entity.name;
  data['whenclever'] = entity.channel;
  return data;
}

extension PayChannelEntityExtension on PayChannelEntity {
  PayChannelEntity copyWith({
    String? name,
    String? channel,
  }) {
    return PayChannelEntity()
      ..name = name ?? this.name
      ..channel = channel ?? this.channel;
  }
}